package com.think.common.model;

import java.util.Collection;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

public class CustomUser extends User {
	private Integer loginType;

	private Integer userId;
	
	private Object payload;

	public CustomUser(String username, String password, Collection<? extends GrantedAuthority> authorities,
			Integer loginType, Integer userId) {
		this(username, password, true, true, true, true, authorities, loginType, userId,null);
	}
	public CustomUser(String username, String password, Collection<? extends GrantedAuthority> authorities,
			Integer loginType, Integer userId,Object payload) {
		this(username, password, true, true, true, true, authorities, loginType, userId,payload);
	}

	public CustomUser(String username, String password, boolean enabled, boolean accountNonExpired,
			boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends GrantedAuthority> authorities,
			Integer loginType, Integer userId,Object payload) {
		super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities);
		this.loginType = loginType;
		this.userId = userId;
		this.payload = payload;
	}

	public int getLoginType() {
		return loginType;
	}

	public void setLoginType(int loginType) {
		this.loginType = loginType;
	}

	/**
	 * @return the userId
	 */
	public Integer getUserId() {
		return userId;
	}

	/**
	 * @param userId the userId to set
	 */
	public void setUserId(Integer userId) {
		this.userId = userId;
	}

	public Object getPayload() {
		return payload;
	}

	public void setPayload(Object payload) {
		this.payload = payload;
	}
}
